package net.techwatch.commons.utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.apache.commons.io.IOUtils;

public class ResourceUtils {

	public static Properties loadFromClasspath(String filename) {
		InputStream inStream = FileUtils.class.getClassLoader()
				.getResourceAsStream(filename);
		Properties properties = new Properties();
		try {
			if (inStream != null) {
				properties.load(inStream);
				return properties;
			}
	
			return null;
		} catch (IOException e) {
			return null;
		} finally {
			IOUtils.closeQuietly(inStream);
		}
	}

}
